package com.acoresoft.sm.service;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.acoresoft.sm.entity.User;
import com.acoresoft.sm.mapper.UserMapper;

@Service("userService")
public class UserService {
		
	@Autowired
	private UserMapper userMapper;	

	public void addUser(User user) {
		this.userMapper.addUser(user);	
	}
	
	public int checkUserExits(User user) {			
		return this.userMapper.checkUserExits(user);		
	}

	public void delUser(String userId) {
		this.userMapper.delUser(userId);
	}


	public User getUserByUid(String userId) {		
		return (User)this.userMapper.getUserByUid(userId);
	}
	
	public List<User> getUserByUids(List<String> classList) {		
		return this.userMapper.getUserByUids(classList);
	}

	public List<User> getUserList() {		
		return (List<User>)this.userMapper.getUserList();
	}	
	
	public List<User> getUserListByQuery(Map map) {		
		return (List<User>)this.userMapper.getUserListByQuery(map);
	}	
	
	public List<User> getUserListByQueryUser(User user) {		
		return (List<User>)this.userMapper.getUserListByQueryUser(user);
	}	

	public void editUser(User user) {		
		this.userMapper.editUser(user);
	}
	
	public Long getCounts(){
		return this.userMapper.getCounts();
	}	
	
	
	public List<Object[]> getUserDynamicSql(Object [] objs,RowBounds rw){
		return this.userMapper.getUserDynamicSql(objs, rw);
	}
	
	public List<User> pageList(Map<String,Object> params,RowBounds rw){
		return this.userMapper.pageList(params, rw);
	}
	
	public List<User> pageList(Map<String,Object> params){
		return this.userMapper.pageList(params);
	}
	
	public Long pageCounts(Map<String,Object> p){
		return this.userMapper.pageCounts(p);
	}
}
